package net.zoneland.knowledge.service;

import net.zoneland.knowledge.exceptions.WorkApplyException;
import net.zoneland.knowledge.model.LoginUserPojo;
import net.zoneland.knowledge.model.WorkApplyInfo;
import net.zoneland.uniflow.client.UserInfo;

/**
 * 印章申请service.
 */
public interface ChapterApplyInfoService {

    /**
     * 用章申请起草.
     * @param info 工单信息
     * @param user 当前用户
     */
    void saveDraft(WorkApplyInfo info, LoginUserPojo user);

    /**
     * 起草提交.
     * @param info 工单信息
     * @param taskId 任务id
     * @param opinion 审批意见
     * @param user 当前用户
     */
    void submitDraft(WorkApplyInfo info, String taskId, String opinion, LoginUserPojo user);

    /**
     * 提交任务.
     * @param taskId 任务id
     * @param info 工单信息
     * @param opinion 意见
     * @param user 当前用户
     */
    void submit(String taskId, WorkApplyInfo info,  String opinion, LoginUserPojo user);

    /**
     * 流程退回.
     * @param workApplyId 工单Id
     * @param taskId 任务id
     * @param rejectReason 回退原因
     * @param user 当前用户
     */
    void chapterReject(String workApplyId, String taskId, String rejectReason, LoginUserPojo user);

    /**
     * 退回起草.
     * @param workApplyId 工单Id
     * @param taskId 任务id
     * @param opinion 回退原因
     * @param user 当前用户
     */
    void backToDraft(String workApplyId, String taskId, String opinion, LoginUserPojo user);

    /**
     * 转交工单.
     * @param taskId 任务id
     * @param info 工单信息
     * @param opinion 意见
     * @param user 当前用户
     * @param transferUser 转交人
     * @throws WorkApplyException 智办工单处理异常
     */
    void transfer(final String taskId, final WorkApplyInfo info, final String opinion, final LoginUserPojo user, final UserInfo transferUser) throws WorkApplyException;

}
